﻿using Abp.Application.Services.Dto;
using System;

namespace ARchGL.Platform.Organizations.Dto
{
    public class OrganizationUnitDto : AuditedEntityDto<long>
    {
        /// <summary>
        /// 组织（公司） GUID 标识
        /// </summary>
        public Guid PrimaryId { get; set; }
        public long? ParentId { get; set; }

        public string ParentName { get; set; }

        public string Code { get; set; }

        public string DisplayName { get; set; }

        public int MemberCount { get; set; }
        /// <summary>
        /// 排序
        /// </summary>
        public int Sort { get; set; }
        /// <summary>
        /// 级别
        /// </summary>
        public int Level { get; set; }
        /// <summary>
        /// 描述
        /// </summary>
        public string Description { get; set; }
        /// <summary>
        /// 创建时间戳
        /// </summary>
        public long CreationUniversalTime { get { return CreationTime.ToUnixTimestamp(); } }
        /// <summary>
        /// 最后修改日期时间戳
        /// </summary>
        public long LastModificationUniversalTime
        {
            get
            {
                return LastModificationTime.HasValue 
                    ? LastModificationTime.Value.ToUnixTimestamp()
                    : DateTime.MinValue.ToUnixTimestamp();
            }
        }
    }
}